//
//  YFShopkeeperInformationVC.m
//  QuanJieShopProject
//
//  Created by apple on 2018/5/22.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YFShopkeeperInformationVC.h"
#import "YFShopkeeperInformationCell.h"
#import "QJMineOrderPageVC.h"
#import "YFKaiDianVC.h"
#import "YFLogisticsViewController.h"

#import "YFShopkeeperOrderVC.h"
#import "QJMineSKJLVC.h"
@interface YFShopkeeperInformationVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *dataArr;
@end

@implementation YFShopkeeperInformationVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"商户信息";
    // Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    
    [self.tableView reloadData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 50;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    YFShopkeeperInformationCell *cell = [YFShopkeeperInformationCell cellWithTableView:tableView];
    [cell updateWithRow:indexPath.row];
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0) {
        
        QJMineSKJLVC *VC = [[QJMineSKJLVC alloc]init];
        KPushViewControllerAction(VC);
        
    }
    
    
    if (indexPath.row == 1) { // 订单管理
        
        //        QJMineOrderPageVC *VC = [[QJMineOrderPageVC alloc]init];
        //        VC.htopViewBtnTag = 0;
        //        [self.navigationController pushViewController:VC animated:YES];
        
        YFShopkeeperOrderVC *vc = [[YFShopkeeperOrderVC alloc] init];
        KPushViewControllerAction(vc);
        
    }
    //    else if (indexPath.row == 1) { // 物流信息
    //        YFLogisticsViewController *VC = [[YFLogisticsViewController alloc] init];
    //        KPushViewControllerAction(VC);
    //
    //    }
    else if (indexPath.row == 2) { // 查看店铺
        YFKaiDianVC *VC = [[YFKaiDianVC alloc]init];
        VC.type = YFKaiDianVCType_See;
        KPushViewControllerAction(VC);
        
    }
    else if (indexPath.row == 3) { // 修改店铺
        YFKaiDianVC *VC = [[YFKaiDianVC alloc]init];
        VC.type = YFKaiDianVCType_Edit;
        KPushViewControllerAction(VC);
    }
    
}

- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
        _tableView.backgroundColor = YFColor_Background;
        _tableView.delegate = self;
        _tableView.dataSource = self;
        [self.view addSubview:_tableView];
        
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        //        _tableView.tableFooterView = [[UIView alloc] init];
    }
    return _tableView;
}
@end

